#include "stc15f2k60s2.h"
#include <intrins.h>
#include "lcd12864.h"





unsigned char code tu1[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x06,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x3C,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x01,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,0x0C,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x7F,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,0x0E,0x00,0x00,0x00,
0x00,0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x0F,0x00,0x00,0x00,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x08,0x0F,0x00,0x00,0x00,
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x1C,0x0F,0x80,0x00,0x00,
0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x1C,0x0F,0x80,0x00,0x00,
0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x1E,0x0F,0x80,0x00,0x00,
0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFE,0x00,0x00,0x00,0x00,0x1E,0x0F,0xC0,0x00,0x00,
0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x1E,0x0F,0xC0,0x00,0x00,
0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x1E,0x0F,0xC0,0x00,0x00,
0x00,0x00,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x3E,0x0F,0xC0,0x00,0x00,
0x00,0x03,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,0x3E,0x0F,0xC0,0x00,0x00,
0x00,0x07,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x3E,0x0F,0xC0,0x00,0x00,
0x00,0x07,0xFF,0xFF,0xC0,0x00,0x00,0x03,0xC0,0x00,0x00,0x7E,0x1F,0xC0,0x00,0x00,
0x00,0x1F,0xFF,0xFF,0x00,0x00,0x00,0x03,0xC0,0x00,0x00,0xFE,0x1F,0xC0,0x00,0x00,
0x00,0x3F,0xFF,0xF8,0x00,0x00,0x01,0xFF,0x80,0x00,0x00,0xFE,0x3F,0xC0,0x00,0x00,
0x00,0x7F,0xFF,0xF0,0x00,0x00,0x03,0xFF,0x80,0x00,0x01,0xFE,0x7F,0x80,0x00,0x00,
0x00,0x7F,0xFF,0xC0,0x00,0x00,0x00,0x7F,0xC0,0x00,0x01,0xFE,0x7F,0x8C,0x00,0x00,
0x00,0xFF,0xFF,0x80,0x00,0x00,0x00,0x3F,0xC0,0x00,0x01,0xFE,0xFF,0x8C,0x00,0x00,
0x00,0xFF,0xFF,0x00,0x00,0x00,0x00,0x1F,0xC0,0x00,0x03,0xFC,0xFF,0x1C,0x00,0x00,
0x01,0xFF,0xFE,0x00,0x00,0x00,0x00,0x1F,0x80,0x00,0x07,0xF9,0xFF,0x1C,0x00,0x00,
0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,0x3F,0x80,0x00,0xFF,0xF9,0xFE,0x1C,0x00,0x00,
0x03,0xFF,0xF8,0x00,0x00,0x00,0x00,0x7F,0x80,0x03,0xFF,0xFB,0xFE,0x3C,0x00,0x00,
0x07,0xFF,0xF8,0x00,0x00,0x00,0x00,0x7F,0x80,0x7F,0xFF,0xE7,0xFC,0x7C,0x00,0x00,
0x07,0xFF,0xF8,0x00,0x00,0x00,0x01,0xFF,0xFF,0xFF,0xFF,0xEF,0xF8,0xF8,0x00,0x00,
0x07,0xFF,0xF8,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xDF,0xFF,0xF0,0xF8,0x00,0x00,
0x07,0xFF,0xF0,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xE1,0xF0,0x00,0x00,
0x07,0xFF,0xF0,0x00,0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0x7F,0xC3,0xF0,0x00,0x00,
0x07,0xFF,0xE0,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0x03,0xF0,0x00,0x00,
0x07,0xFF,0xE0,0x00,0x00,0x00,0x07,0xFF,0xFF,0xF9,0xFD,0xFE,0x0F,0xF0,0x00,0x00,
0x07,0xFF,0xE0,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFC,0x0F,0xE0,0x00,0x00,
0x07,0xFF,0xE0,0x00,0x00,0x00,0x07,0xFF,0xFF,0xEF,0xEF,0xF0,0x1F,0xC0,0x00,0x00,
0x07,0xFF,0xF0,0x00,0x00,0x00,0x07,0xFF,0xFF,0x9F,0xFF,0xC0,0x7F,0x80,0x00,0x00,
0x07,0xFF,0xF0,0x00,0x00,0x00,0x07,0xFF,0xFF,0x3F,0xFF,0x00,0xFF,0x80,0x00,0x00,
0x03,0xFF,0xF8,0x00,0x00,0x00,0x03,0xFF,0xFC,0x7E,0xFC,0x01,0xFF,0x00,0x00,0x00,
0x01,0xFF,0xF8,0x00,0x00,0x00,0x00,0xFF,0xE1,0xF9,0xC0,0x03,0xFE,0x00,0x00,0x00,
0x01,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x03,0xE0,0x00,0x0F,0xFE,0x00,0x00,0x00,
0x00,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x03,0x80,0x00,0x3F,0xFC,0x00,0x00,0x00,
0x00,0xFF,0xFE,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xF0,0x00,0x00,0x00,
0x00,0x7F,0xFF,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xFF,0xE0,0x00,0x00,0x00,
0x00,0x7F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xFF,0xC0,0x00,0x00,0x00,
0x00,0x3F,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0x80,0x00,0x00,0x00,
0x00,0x1F,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,0x7F,0xFE,0x00,0x00,0x00,0x00,
0x00,0x0F,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0xFE,0x00,0x00,0x00,0x00,
0x00,0x07,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x1F,0xFF,0xF8,0x00,0x00,0x00,0x00,
0x00,0x01,0xFF,0xFF,0x80,0x00,0x00,0x00,0x01,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,
0x00,0x01,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x1F,0xFF,0xFF,0xC0,0x00,0x00,0x00,0x00,
0x00,0x00,0x7F,0xFF,0xFC,0x00,0x00,0x01,0xFF,0xFF,0xFF,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x3F,0xFF,0xFF,0xF8,0x0F,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xE0,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x03,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x7F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFC,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xFF,0xFF,0xF0,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x3F,0xFF,0xFF,0xFF,0xF8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x07,0xFF,0xFF,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x03,0xFF,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,};


unsigned char code tu2[]={
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x20,0x00,0x00,0x03,0x80,0x00,0x00,0x00,
0x01,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x70,0x00,0x00,0x03,0x80,0x1C,0x00,0x00,
0x01,0xE2,0x01,0x80,0x00,0x00,0x00,0x03,0x70,0x03,0x80,0x03,0x00,0x7E,0x00,0x30,
0x01,0xE6,0x01,0x80,0x03,0x00,0x10,0x03,0xF0,0x03,0xC0,0x1F,0x80,0x7E,0x01,0x30,
0x00,0xCF,0x01,0xF0,0x07,0x80,0x38,0x07,0xF0,0x0F,0xC0,0x1F,0x80,0x7E,0x03,0xB0,
0x01,0xCC,0x01,0xF8,0x03,0xE0,0x18,0x07,0xE0,0x1F,0xE0,0x1F,0x80,0xFE,0x03,0xB0,
0x03,0xCE,0x01,0xF8,0x03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3F,0xC0,0x18,0x06,0x1F,
0x07,0xEF,0x07,0xC0,0x03,0x00,0x30,0x07,0xE0,0x0C,0x30,0x3E,0x00,0x38,0x00,0x0F,
0x07,0xEF,0x07,0xC0,0x03,0x00,0x30,0x07,0xE0,0x08,0x30,0x3E,0x00,0x78,0x00,0x0F,
0x07,0xCC,0x06,0xC0,0x03,0x00,0x30,0x02,0xE0,0x00,0x30,0x06,0x00,0x00,0x00,0x00,
0x06,0xC0,0x00,0x40,0x03,0x00,0x10,0x00,0xC0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x06,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x19,0xF5,0x8F,0xAD,0x67,0xEC,0xD7,0x9B,0xEF,0x59,0x97,0xFA,0xD4,0x3B,0x57,0x7C,
0x1B,0xF7,0xCF,0xAD,0xEF,0xFF,0xFF,0xDB,0xEF,0xFF,0xF7,0xFF,0xF6,0x7F,0xD7,0xFC,
0x1B,0x7E,0xDB,0xAD,0xEF,0x9B,0x7F,0x5A,0xFB,0xEE,0xFB,0xEF,0xF6,0x6D,0xDD,0xDC,
0x1B,0x7E,0x1B,0xAD,0xED,0x93,0x3F,0x7A,0xF9,0xE6,0x3B,0xEF,0xFE,0x7C,0xFD,0xDC,
0x1B,0x7E,0xD9,0xAF,0xEF,0xF3,0x3F,0x7F,0xB1,0xE6,0x3B,0xE7,0xFE,0x3C,0xFD,0xDC,
0x1B,0x7E,0xDB,0xAF,0xE3,0x93,0x3F,0x7E,0xD1,0xA6,0xFB,0xE7,0xFE,0x1D,0xDD,0xDC,
0x1B,0x7E,0xDF,0xBF,0xEF,0x9F,0x7F,0x7E,0xD1,0xAE,0xEB,0xEE,0xFE,0x6D,0xDD,0xDC,
0x1F,0xFF,0xCF,0xFF,0x6F,0xFF,0xF7,0xFE,0xD1,0xBF,0xEF,0xFE,0xEF,0xFF,0xD7,0xFF,
0x1F,0xEF,0xCF,0xFB,0x67,0xED,0xD7,0xAE,0xD1,0x9B,0xEF,0xFA,0xEF,0xBF,0x57,0x7F,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};







void IO_init(void)
{
  P0M0 = 0X00;	P0M1 = 0X00;
	P1M0 = 0X00;  P1M1 = 0X00;
	P2M0 = 0X00;	P2M1 = 0X00;
	P3M0 = 0X00;	P3M1 = 0X00;
	P4M0 = 0X00;	P4M1 = 0X00;  	
	P5M0 = 0X00;	P5M1 = 0X00;  	
	P6M0 = 0X00;	P6M1 = 0X00;  	
	P7M0 = 0X00;	P7M1 = 0X00;  
}


void Tupian(unsigned char *tu)
{
	unsigned char j,i;
	LCD12864_WriteCmd(0x34);
	for(i=0;i<32;i++)
	{
	LCD12864_WriteCmd(0x80+i);
	LCD12864_WriteCmd(0x80);
	for(j=0;j<16;j++)LCD12864_WriteData(*tu++);
	}
	for(i=0;i<32;i++)
	{
	LCD12864_WriteCmd(0x80+i);
	LCD12864_WriteCmd(0x98);
	for(j=0;j<16;j++)LCD12864_WriteData(*tu++);
	}
	LCD12864_WriteCmd(0x36);
	LCD12864_WriteCmd(0x30);
}





void main()
{
	IO_init();	
	
	P2M1 &= ~(1<<2),P2M0 |=  (1<<2); 
	P2M1 &= ~(1<<1),P2M0 |=  (1<<1); 
	P2M1 &= ~(1<<0),P2M0 |=  (1<<0);
	


 
	
	while(1)
 {
	LCD12864_Delay1ms(10000);
  {
   Tupian(tu1);
	}
	LCD12864_Delay1ms(10000);
	{
   Tupian(tu2);	
	}
 }
}


	
	